#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# ======================================================
# @File:      : pack_whl
# @Author     : forward_huan
# @Date       : 2024/6/25 23:44
# @Desc       :
# ======================================================
import os

from apidoc_md.main import create_md
from pack_tool import dirPath
from pack_tool.pack.pack_whl import createWhl
from pack_tool.version import getVersionNum


def getPyPath(root_path):
    """获取python路径"""
    return os.path.join(root_path, "venv", "Scripts", "python.exe")


def run():
    root_path = dirPath(os.path.abspath(__file__), level=1)
    out_dir = os.path.join(root_path, "out")
    create_md(root_path=root_path, pkg_path_data="simulator_tool", save_dir=out_dir)
    os.rename(os.path.join(out_dir, "api.md"), os.path.join(out_dir, "README.md"))
    createWhl(
        root_path, "simulator_tool", name="SimulatorTool", version=getVersionNum(10), include_source=False,
        readme_path=os.path.join(out_dir, "README.md"), long_desc="", whl_dir=os.path.join(root_path, "out"),
        install_requires=[], python_path=getPyPath(root_path)
    )


if __name__ == '__main__':
    run()
